Optimal. Leaf size=128 \[ \frac {\text {Li}_3\left (-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {x^2}{2 b}-\frac {i x^3}{3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3720, 3475, 30, 3719, 2190, 2531, 2282, 6589} \[ -\frac {i x \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^2}+\frac {\text {Li}_3\left (-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {x \tan (a+b x)}{b^2}-\frac {\log (\cos (a+b x))}{b^3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {x^2}{2 b}-\frac {i x^3}{3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2190
Rule 2282
Rule 2531
Rule 3475
Rule 3719
Rule 3720
Rule 6589
Rubi steps
\begin {align*} \int x^2 \tan ^3(a+b x) \, dx &=\frac {x^2 \tan ^2(a+b x)}{2 b}-\frac {\int x \tan ^2(a+b x) \, dx}{b}-\int x^2 \tan (a+b x) \, dx\\ &=-\frac {i x^3}{3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+2 i \int \frac {e^{2 i (a+b x)} x^2}{1+e^{2 i (a+b x)}} \, dx+\frac {\int \tan (a+b x) \, dx}{b^2}+\frac {\int x \, dx}{b}\\ &=\frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}-\frac {2 \int x \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {i \int \text {Li}_2\left (-e^{2 i (a+b x)}\right ) \, dx}{b^2}\\ &=\frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {\operatorname {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3}\\ &=\frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^2}+\frac {\text {Li}_3\left (-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.14, size = 172, normalized size = 1.34 \[ \frac {-4 b^3 x^3 \tan (a)+e^{-i a} \sec (a) \left (2 b^2 x^2 \left (3 \left (1+e^{2 i a}\right ) \log \left (1+e^{-2 i (a+b x)}\right )+2 i b x\right )+6 i \left (1+e^{2 i a}\right ) b x \text {Li}_2\left (-e^{-2 i (a+b x)}\right )+3 \left (1+e^{2 i a}\right ) \text {Li}_3\left (-e^{-2 i (a+b x)}\right )\right )+6 b^2 x^2 \sec ^2(a+b x)-12 b x \sec (a) \sin (b x) \sec (a+b x)-12 (b x \tan (a)+\log (\cos (a+b x)))}{12 b^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [C] time = 0.54, size = 240, normalized size = 1.88 \[ \frac {2 \, b^{2} x^{2} \tan \left (b x + a\right )^{2} + 2 \, b^{2} x^{2} + 2 i \, b x {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 2 i \, b x {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 4 \, b x \tan \left (b x + a\right ) + 2 \, {\left (b^{2} x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b^{2} x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right )}{4 \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \tan \left (b x + a\right )^{3}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.29, size = 180, normalized size = 1.41 \[ -\frac {i x^{3}}{3}+\frac {2 x \left (b x \,{\mathrm e}^{2 i \left (b x +a \right )}-i {\mathrm e}^{2 i \left (b x +a \right )}-i\right )}{b^{2} \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )^{2}}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {4 i a^{3}}{3 b^{3}}+\frac {x^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b}-\frac {i x \polylog \left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b^{2}}+\frac {\polylog \left (3, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{2 b^{3}}-\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b^{3}}+\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 i a^{2} x}{b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.18, size = 740, normalized size = 5.78 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int x^2\,{\mathrm {tan}\left (a+b\,x\right )}^3 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \tan ^{3}{\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________